import request from '@/utils/request'

// 查询后台-客户列表
export function listCustomer(query) {
  return request({
    url: '/admin/customer/list',
    method: 'get',
    params: query
  })
}

// 查询后台-客户详细
export function getCustomer(id) {
  return request({
    url: '/admin/customer/' + id,
    method: 'get'
  })
}

// 新增后台-客户
export function addCustomer(data) {
  return request({
    url: '/admin/customer',
    method: 'post',
    data: data
  })
}

// 修改后台-客户
export function updateCustomer(data) {
  return request({
    url: '/admin/customer',
    method: 'put',
    data: data
  })
}

// 删除后台-客户
export function delCustomer(id) {
  return request({
    url: '/admin/customer/' + id,
    method: 'delete'
  })
}

// 升级客户为会员
// export function updateCustomerLevel(id) {
//   return request({
//     url: '/admin/customer/handleLevel/' + id,
//     method: 'put'
//   })
// }
export function updateCustomerLevel(id) {
  return request({
    url: '/admin/customer/handleLevel',
    method: 'get',
    params: {
      id: id
    }
  })
}
